<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="/publico/template.xhtml">

            <ui:define name="content">
                <h:form id="fcancelar">
                    <p:commandButton 
                        id="cbcancelar"
                        ajax="false" 
                        action="#{loteBean.cancelarPesagem}" 
                        value="Cancelar"/>
                </h:form>
                <h:form id="formLote">
                    <p:panel header="Alterar Lote numero #{loteBean.lote.id}">
                        <h:inputHidden value="#{loteBean.lote.id}"/>
                        <h:panelGrid columns="2" cellpadding="10">
                            <h:outputLabel for="massa" value="Massa: *"/>
                            <p:inputText id="massa" value="#{loteBean.lote.massa}" required="true"/>
                            <h:outputLabel for="dataP" value="Data da Pesagem: *"/>
                            <p:calendar id="dataP" value="#{loteBean.lote.dataPesagem}" pattern="dd/MM/yyyy" required="true"/>
                            <h:outputLabel for="cardapioSelect" value="Cardapio: *"/>
                            <h:selectOneMenu id="cardapioSelect" value="#{loteBean.lote.cardapio}">
                                <f:selectItems value="#{loteBean.cardapios}"/>
                                <f:converter converterId="CardapioConversor"/>
                            </h:selectOneMenu>
                            <h:outputLabel for="localOrigemSelect" value="Local de origem: *"/>
                            <h:selectOneMenu id="localOrigemSelect" value="#{loteBean.lote.origem}">
                                <f:selectItems value="#{transporteBean.selectLocal}"/>
                                <f:converter converterId="LocalConversor"/>
                            </h:selectOneMenu>
                            <h:outputLabel for="localDestinoSelect" value="Local atual: *"/>
                            <h:selectOneMenu id="localDestinoSelect" value="#{loteBean.lote.localizacao}">
                                <f:selectItems value="#{transporteBean.selectLocal}"/>
                                <f:converter converterId="LocalConversor"/>
                            </h:selectOneMenu>
                            <p:commandButton id="salvar" ajax="false" action="#{loteBean.salvar}" value="Alterar"/>
                        </h:panelGrid>
                    </p:panel>
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
